.class public Lcom/waiqin365/h5/io/a/a;
.super Ljava/lang/Object;


# direct methods
.method public static a(Lcom/waiqin365/h5/io/a/c;)Lcom/waiqin365/h5/io/a/d;
    .locals 2

    invoke-virtual {p0}, Lcom/waiqin365/h5/io/a/c;->b()I

    move-result v0

    packed-switch v0, :pswitch_data_0

    const/4 v0, 0x0

    :goto_0
    return-object v0

    :pswitch_0
    new-instance v0, Lcom/waiqin365/h5/io/a/d;

    const/16 v1, 0x65

    invoke-direct {v0, v1}, Lcom/waiqin365/h5/io/a/d;-><init>(I)V

    goto :goto_0

    nop

    :pswitch_data_0
    .packed-switch 0x1
        :pswitch_0
    .end packed-switch
.end method

.method public static a(Lcom/waiqin365/h5/io/a/c;ZLandroid/os/Handler;)Lcom/waiqin365/h5/io/a/d;
    .locals 13

    const-string/jumbo v1, ""

    invoke-static {}, Lcom/fiberhome/gaea/client/base/ExmobiApp;->b()Lcom/fiberhome/gaea/client/base/ExmobiApp;

    move-result-object v1

    invoke-virtual {v1}, Lcom/fiberhome/gaea/client/base/ExmobiApp;->getApplicationContext()Landroid/content/Context;

    move-result-object v2

    :try_start_0
    invoke-virtual {p0}, Lcom/waiqin365/h5/io/a/c;->c()Ljava/lang/String;

    move-result-object v3

    move-object v0, p0

    check-cast v0, Lcom/waiqin365/h5/io/a/a/a;

    move-object v1, v0

    iget-object v4, v1, Lcom/waiqin365/h5/io/a/a/a;->a:Lcom/waiqin365/h5/io/b/a;

    iget v5, v4, Lcom/waiqin365/h5/io/b/a;->c:I

    new-instance v1, Ljava/lang/StringBuilder;

    invoke-direct {v1}, Ljava/lang/StringBuilder;-><init>()V

    sget-object v6, Lcom/fiberhome/gaea/client/b/a/a;->e:Ljava/lang/String;

    invoke-virtual {v1, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string/jumbo v6, "/"

    invoke-virtual {v1, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    new-instance v6, Ljava/io/File;

    invoke-direct {v6, v1}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    invoke-virtual {v6}, Ljava/io/File;->exists()Z

    move-result v7

    if-nez v7, :cond_0

    invoke-virtual {v6}, Ljava/io/File;->mkdirs()Z

    :cond_0
    new-instance v6, Ljava/lang/StringBuilder;

    invoke-direct {v6}, Ljava/lang/StringBuilder;-><init>()V

    invoke-virtual {v6, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    iget-object v6, v4, Lcom/waiqin365/h5/io/b/a;->b:Ljava/lang/String;

    invoke-virtual {v1, v6}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v6

    const/4 v1, 0x0

    invoke-static {v3, v1}, Lcom/waiqin365/compons/b/a;->a(Ljava/lang/String;Ljava/util/HashMap;)Ljava/io/InputStream;

    move-result-object v3

    new-instance v7, Ljava/io/FileOutputStream;

    new-instance v1, Ljava/io/File;

    invoke-direct {v1, v6}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    const/4 v8, 0x0

    invoke-direct {v7, v1, v8}, Ljava/io/FileOutputStream;-><init>(Ljava/io/File;Z)V

    const/16 v1, 0x1000

    new-array v8, v1, [B

    const/4 v1, 0x0

    :cond_1
    :goto_0
    invoke-virtual {v3, v8}, Ljava/io/InputStream;->read([B)I

    move-result v9

    const/4 v10, -0x1

    if-eq v9, v10, :cond_3

    const/4 v10, 0x0

    invoke-virtual {v7, v8, v10, v9}, Ljava/io/FileOutputStream;->write([BII)V

    add-int/2addr v1, v9

    new-instance v9, Landroid/os/Message;

    invoke-direct {v9}, Landroid/os/Message;-><init>()V

    const v10, 0x12340

    iput v10, v9, Landroid/os/Message;->what:I

    new-instance v10, Landroid/os/Bundle;

    invoke-direct {v10}, Landroid/os/Bundle;-><init>()V

    const-string/jumbo v11, "fileName"

    iget-object v12, v4, Lcom/waiqin365/h5/io/b/a;->b:Ljava/lang/String;

    invoke-virtual {v10, v11, v12}, Landroid/os/Bundle;->putString(Ljava/lang/String;Ljava/lang/String;)V

    mul-int/lit8 v11, v1, 0x64

    div-int/2addr v11, v5

    iput v11, v9, Landroid/os/Message;->arg1:I

    invoke-virtual {v9, v10}, Landroid/os/Message;->setData(Landroid/os/Bundle;)V

    if-eqz p2, :cond_1

    invoke-virtual {p2, v9}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
    :try_end_0
    .catch Ljava/net/SocketTimeoutException; {:try_start_0 .. :try_end_0} :catch_0
    .catch Ljava/net/UnknownHostException; {:try_start_0 .. :try_end_0} :catch_1
    .catch Ljava/lang/Exception; {:try_start_0 .. :try_end_0} :catch_2

    goto :goto_0

    :catch_0
    move-exception v1

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v4, "H5IO\u8d85\u65f6\u5f02\u5e38="

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v1}, Ljava/net/SocketTimeoutException;->getMessage()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string/jumbo v3, " cmdtype:"

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {p0}, Lcom/waiqin365/h5/io/a/c;->b()I

    move-result v3

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/fiberhome/gaea/client/d/d;->a(Ljava/lang/String;)V

    invoke-static {p0}, Lcom/waiqin365/h5/io/a/a;->a(Lcom/waiqin365/h5/io/a/c;)Lcom/waiqin365/h5/io/a/d;

    move-result-object v1

    const/4 v3, 0x0

    invoke-virtual {v1, v3}, Lcom/waiqin365/h5/io/a/d;->a(Z)V

    const/4 v3, 0x1

    iput-boolean v3, v1, Lcom/waiqin365/h5/io/a/d;->a:Z

    const v3, 0x7f080286

    invoke-virtual {v2, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v2

    iput-object v2, v1, Lcom/waiqin365/h5/io/a/d;->c:Ljava/lang/String;

    new-instance v2, Landroid/os/Message;

    invoke-direct {v2}, Landroid/os/Message;-><init>()V

    invoke-virtual {p0}, Lcom/waiqin365/h5/io/a/c;->b()I

    move-result v3

    iput v3, v2, Landroid/os/Message;->what:I

    iput-object v1, v2, Landroid/os/Message;->obj:Ljava/lang/Object;

    if-eqz p2, :cond_2

    invoke-virtual {p2, v2}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    :cond_2
    :goto_1
    invoke-virtual {p0}, Lcom/waiqin365/h5/io/a/c;->g()I

    move-result v2

    invoke-virtual {v1, v2}, Lcom/waiqin365/h5/io/a/d;->a(I)V

    return-object v1

    :cond_3
    :try_start_1
    invoke-virtual {v7}, Ljava/io/FileOutputStream;->close()V

    invoke-virtual {v3}, Ljava/io/InputStream;->close()V

    invoke-static {p0}, Lcom/waiqin365/h5/io/a/a;->a(Lcom/waiqin365/h5/io/a/c;)Lcom/waiqin365/h5/io/a/d;

    move-result-object v1

    invoke-virtual {v1, v6}, Lcom/waiqin365/h5/io/a/d;->a(Ljava/lang/String;)Z

    move-result v3

    invoke-virtual {v1, v3}, Lcom/waiqin365/h5/io/a/d;->a(Z)V

    const v3, 0x7f080289

    invoke-virtual {v2, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v3

    iput-object v3, v1, Lcom/waiqin365/h5/io/a/d;->c:Ljava/lang/String;

    iput-object v6, v1, Lcom/waiqin365/h5/io/a/d;->d:Ljava/lang/String;

    new-instance v3, Landroid/os/Message;

    invoke-direct {v3}, Landroid/os/Message;-><init>()V

    invoke-virtual {p0}, Lcom/waiqin365/h5/io/a/c;->b()I

    move-result v4

    iput v4, v3, Landroid/os/Message;->what:I

    const/4 v4, 0x1

    invoke-virtual {v1, v4}, Lcom/waiqin365/h5/io/a/d;->a(Z)V

    iput-object v1, v3, Landroid/os/Message;->obj:Ljava/lang/Object;

    if-eqz p2, :cond_2

    invoke-virtual {p2, v3}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z
    :try_end_1
    .catch Ljava/net/SocketTimeoutException; {:try_start_1 .. :try_end_1} :catch_0
    .catch Ljava/net/UnknownHostException; {:try_start_1 .. :try_end_1} :catch_1
    .catch Ljava/lang/Exception; {:try_start_1 .. :try_end_1} :catch_2

    goto :goto_1

    :catch_1
    move-exception v1

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v4, "H5IO\u57df\u540d\u5f02\u5e38="

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v1}, Ljava/net/UnknownHostException;->getMessage()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string/jumbo v3, " cmdtype:"

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {p0}, Lcom/waiqin365/h5/io/a/c;->b()I

    move-result v3

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/fiberhome/gaea/client/d/d;->a(Ljava/lang/String;)V

    invoke-static {p0}, Lcom/waiqin365/h5/io/a/a;->a(Lcom/waiqin365/h5/io/a/c;)Lcom/waiqin365/h5/io/a/d;

    move-result-object v1

    const/4 v3, 0x0

    invoke-virtual {v1, v3}, Lcom/waiqin365/h5/io/a/d;->a(Z)V

    const/4 v3, 0x1

    iput-boolean v3, v1, Lcom/waiqin365/h5/io/a/d;->a:Z

    const v3, 0x7f080285

    invoke-virtual {v2, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v2

    iput-object v2, v1, Lcom/waiqin365/h5/io/a/d;->c:Ljava/lang/String;

    new-instance v2, Landroid/os/Message;

    invoke-direct {v2}, Landroid/os/Message;-><init>()V

    invoke-virtual {p0}, Lcom/waiqin365/h5/io/a/c;->b()I

    move-result v3

    iput v3, v2, Landroid/os/Message;->what:I

    iput-object v1, v2, Landroid/os/Message;->obj:Ljava/lang/Object;

    if-eqz p2, :cond_2

    invoke-virtual {p2, v2}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    goto/16 :goto_1

    :catch_2
    move-exception v1

    new-instance v3, Ljava/lang/StringBuilder;

    invoke-direct {v3}, Ljava/lang/StringBuilder;-><init>()V

    const-string/jumbo v4, "H5IO\u901a\u4fe1\u5f02\u5e38="

    invoke-virtual {v3, v4}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v3

    invoke-virtual {v1}, Ljava/lang/Exception;->getMessage()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {v3, v1}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    const-string/jumbo v3, " cmdtype:"

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {p0}, Lcom/waiqin365/h5/io/a/c;->b()I

    move-result v3

    invoke-virtual {v1, v3}, Ljava/lang/StringBuilder;->append(I)Ljava/lang/StringBuilder;

    move-result-object v1

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-static {v1}, Lcom/fiberhome/gaea/client/d/d;->a(Ljava/lang/String;)V

    invoke-static {p0}, Lcom/waiqin365/h5/io/a/a;->a(Lcom/waiqin365/h5/io/a/c;)Lcom/waiqin365/h5/io/a/d;

    move-result-object v1

    const/4 v3, 0x0

    invoke-virtual {v1, v3}, Lcom/waiqin365/h5/io/a/d;->a(Z)V

    const v3, 0x7f080284

    invoke-virtual {v2, v3}, Landroid/content/Context;->getString(I)Ljava/lang/String;

    move-result-object v2

    iput-object v2, v1, Lcom/waiqin365/h5/io/a/d;->c:Ljava/lang/String;

    new-instance v2, Landroid/os/Message;

    invoke-direct {v2}, Landroid/os/Message;-><init>()V

    invoke-virtual {p0}, Lcom/waiqin365/h5/io/a/c;->b()I

    move-result v3

    iput v3, v2, Landroid/os/Message;->what:I

    iput-object v1, v2, Landroid/os/Message;->obj:Ljava/lang/Object;

    if-eqz p2, :cond_2

    invoke-virtual {p2, v2}, Landroid/os/Handler;->sendMessage(Landroid/os/Message;)Z

    goto/16 :goto_1
.end method
